<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_JS运算符</title>
</head>
<body>
<script>
    console.log(6/2);
    console.log(3/2);

    //比较运算符的结果是布尔类型
    //如果比较运算符任意一侧有数字,会将非数字转为数字再进行比较
    //如果比较运算符两侧均为字符串,比较的是字符的编码值
    //'33331'.charCodeAt(4) 获取指定下标出字符的编码,默认取第1个字符的编码
    console.log(3 > 10);
    console.log(3 > '10');//Number('10')
    console.log('3' > 10);//Number('3')
    console.log('超'.charCodeAt());
    console.log('宇'.charCodeAt());
    console.log('超' > '宇');//true
    console.log('3'.charCodeAt());//51
    console.log('10'.charCodeAt());//49
    console.log('3' > '10');//true
    console.log('33331'.charCodeAt(4));//49


    let a = 1;
    let b = true;
    console.log(a == b);
    console.log(a === b);

    let c = 0;
    console.log(c == 0 ? 'YES' : 'NO');
</script>
</body>
</html>